import { testFn } from "../utils/common";

class Animal {
  protected color: string;

  constructor(color: string) {
    this.color = color;
  }

  say() {
    console.log(this.color);
  }
}

class Dog extends Animal {
  public color: string;

  constructor(color: string) {
    super(color);
    this.color = color;
  }
}

function classTest() {
  const animal = new Animal("white");
  animal.say();
  //   console.log("--->color:", animal.color);

  const dog = new Dog("yellow");
  dog.say();
}

export default testFn(classTest);
